package cn.hloger.spider.demo.carDemo.carDemo;

import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 正式的
 *
 * @author huanglong
 * @Description TODO
 * @data 2022/9/12
 */
@Service
public class DateUtils {

    public static DateTimeFormatter baseFormat = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");

    public static DateTimeFormatter carFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");


    public static String getTime(LocalDateTime dateTime) {
        return dateTime.format(baseFormat);
    }

    public static String getCarTime(LocalDateTime dateTime) {
        return dateTime.format(carFormat);
    }
}
